import "./global.css";
import { createRoot } from "react-dom/client";
import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";
import { AppProvider } from "@/App";
import { store, persistor } from "@/store";

createRoot(document.getElementById("root") as HTMLElement).render(
  <Provider store={store}>
    <PersistGate loading={null} persistor={persistor}>
      <AppProvider />
    </PersistGate>
  </Provider>
);

// 开启 Mock
//if (process && process.env && process.env.APP_MSW_MOCK) {
//  await import("./mocks").then(({ mock }) => mock());
//}
await import("./mocks").then(({ mock }) => mock());
